<template>
  <div class="login_bg">
    <div class="login_adv">
      <div class="login_adv__title">
        <h2>{{ title}}</h2>
      </div>
      <div class="login_adv__mask"></div>
    </div>
    <div class="login_main">
      <div class="login-form">
        <div class="login-header">
          <div class="logo">
            <img src="img/logo.png" />
            <label>{{title}}</label>
          </div>
        </div>
        <el-tabs>
          <el-tab-pane label="密码登录" lazy>
            <div style="height: 40vh;">
              <el-form ref="loginForm" :model="form" :rules="rules" label-width="0" size="large">
                <el-form-item prop="account">
                  <el-input v-model="form.account" prefix-icon="el-icon-user" clearable placeholder="请输入"></el-input>
                </el-form-item>
                <el-form-item prop="password">
                  <el-input v-model="form.password" prefix-icon="el-icon-lock" clearable show-password placeholder="请输入"></el-input>
                </el-form-item>
                <el-form-item prop="code">
                  <el-input v-model="form.code" placeholder="请输入" clearable prefix-icon="el-icon-set-up"></el-input>
                </el-form-item>
                <el-form-item>
                  <el-button type="primary" style="width: 100%" round @click="login">登录</el-button>
                </el-form-item>
                <el-divider style="margin: 8px 0px 0px 0px;" />
                <div class="register">
                  <span @click="register">免费注册</span>
                  <span style="display: inline-block;margin0px 10px">|</span>
                  <span @click="portal">管理员登录</span>
                </div>
              </el-form>
            </div>
          </el-tab-pane>
        </el-tabs>
      </div>
    </div>
  </div>
</template>
  
  <script>
export default {
  data() {
    return {
      title: process.env.VUE_APP_TITLE,
      rules: {
        account: [
          {
            required: true,
            message: '请输入您的账号',
            trigger: 'blur'
          }
        ],
        password: [
          {
            required: true,
            message: '请输入您的密码',
            trigger: 'blur'
          }
        ],
        code: [
          {
            required: true,
            trigger: 'blur',
            message: '验证码不能空'
          }
        ]
      },
      form: {},
      WechatLoginCode: '',
      showWechatLogin: false,
      isWechatLoginResult: false
    }
  },
  watch: {},
  created: function () {},
  methods: {
    login() {},
    portal() {
      this.$router.push({ path: '/login' })
    },
    register() {
      this.$router.push({ path: '/register' })
    }
  }
}
</script>
  
  <style scoped>
.login_bg {
  width: 100%;
  height: 100%;
  /* background: #fff; */
  display: flex;
}
.login_adv {
  width: 33.33333%;
  background-color: #555;
  background-image: url('../assets/images/auth_banner.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  position: relative;
}
.login_adv__title {
  color: #fff;
  padding: 40px;
  position: absolute;
  top: 0px;
  left: 0px;
  right: 0px;
  z-index: 2;
}
.login_adv__title h2 {
  font-size: 40px;
}
.login_adv__title h4 {
  font-size: 18px;
  margin-top: 10px;
  font-weight: normal;
}
.login_adv__title p {
  font-size: 14px;
  margin-top: 10px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.6);
}
.login_adv__title div {
  margin-top: 10px;
  display: flex;
  align-items: center;
}
.login_adv__title div span {
  margin-right: 15px;
}
.login_adv__title div i {
  font-size: 40px;
}
.login_adv__title div i.add {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.6);
}
.login_adv__bottom {
  position: absolute;
  left: 0px;
  right: 0px;
  bottom: 0px;
  color: #fff;
  padding: 40px;
  background-image: linear-gradient(transparent, #000);
  z-index: 3;
}
.login_adv__mask {
  position: absolute;
  top: 0px;
  left: 0px;
  right: 0px;
  bottom: 0px;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.login_main {
  flex: 1;
  overflow: auto;
  display: flex;
}
.login-form {
  width: 400px;
  margin: auto;
  padding: 20px 0;
}
.login-header {
  margin-bottom: 40px;
}
.login-header .logo {
  display: flex;
  align-items: center;
}
.login-header .logo img {
  width: 40px;
  height: 40px;
  vertical-align: bottom;
  margin-right: 10px;
}
.login-header .logo label {
  font-size: 26px;
  font-weight: bold;
}
.login-oauth {
  display: flex;
  justify-content: space-around;
}
.login-form .el-divider {
  margin-top: 40px;
}

.login-form {
}
.login-form:deep(.el-tabs) .el-tabs__header {
  margin-bottom: 25px;
}
.login-form:deep(.el-tabs) .el-tabs__header .el-tabs__item {
  font-size: 14px;
}

.login-form:deep(.login-forgot) {
  text-align: right;
}
.login-form:deep(.login-forgot) a {
  color: var(--el-color-primary);
}
.login-form:deep(.login-forgot) a:hover {
  color: var(--el-color-primary-light-3);
}
.login-form:deep(.login-reg) {
  font-size: 14px;
  color: var(--el-text-color-primary);
}
.login-form:deep(.login-reg) a {
  color: var(--el-color-primary);
}
.login-form:deep(.login-reg) a:hover {
  color: var(--el-color-primary-light-3);
}
.register {
  text-align: center;
  cursor: pointer;
  color: #01040c;
}
.login_config {
  position: absolute;
  top: 20px;
  right: 20px;
}

.qrCodeLogin {
  text-align: center;
  position: relative;
  padding: 20px 0;
}
.qrCodeLogin img.qrCode {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
}
.qrCodeLogin p.msg {
  margin-top: 15px;
}
.qrCodeLogin .qrCodeLogin-result {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  text-align: center;
  background: var(--el-mask-color);
}

@media (max-width: 1200px) {
  .login-form {
    width: 340px;
  }
}
@media (max-width: 1000px) {
  .login_main {
    display: block;
  }
  .login_main .login_config {
    position: static;
    padding: 20px 20px 0 20px;
    text-align: right;
  }
  .login-form {
    width: 100%;
    padding: 20px 40px;
  }
  .login_adv {
    display: none;
  }
}
</style>
  